//
//  SLInputAlertView.m
//  SlockApp
//
//  Created by 凯朱 on 2024/8/2.
//

#import "SLInputAlertView.h"

@implementation SLInputAlertView
-(void)awakeFromNib{
    [super awakeFromNib];
    _bgView.layer.cornerRadius = 30;
    _bgView.layer.masksToBounds = YES;
    _okBtn.layer.cornerRadius = 25;
    _okBtn.layer.masksToBounds = YES;
    _okBtn.btnStyle = 1;
    [_cancelBtn setTitle:kLocalString(@"Cancel") forState:UIControlStateNormal];
    
    _tfBgView.layer.cornerRadius = 20;
    _tfBgView.layer.masksToBounds = YES;
    
    _tf.textColor = KColor_O;
    [_tf setPlaceholderWithPlaceholderText:kLocalString(@"Enter your name") withColor:KColor_placeholdar withFont:kFont(16)];
    [_tf showCloseBtn];
}

- (IBAction)btnAction:(id)sender {
    if (sender == _okBtn) {
        if (_btnBlock) {
            _btnBlock(_tf.text,1);
        }
    }else if (sender == _cancelBtn){
        if (_btnBlock) {
            _btnBlock(_tf.text,2);
        }
    }
}


@end
